package com.wei.czz.common.dto.store;

import com.wei.czz.framework.store.entity.StoreAccountEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-12-14 15:21:04
 * className: StoreAccountViewDto
 * version: 1.0
 * description:
 */
@Getter
@Setter
@Accessors(chain = true)
public class StoreAccountViewDto extends StoreAccountDto {

    /**
     * 银行所在城市名称
     */
    private String bankCityName;

    /**
     * 商店账户数据封装
     * @param storeAccount 商店账户对象
     * @return 封装结果
     */
    public static StoreAccountViewDto map(StoreAccountEntity storeAccount) {
        StoreAccountViewDto storeAccountViewDto = new StoreAccountViewDto();
        storeAccountViewDto.setId(storeAccount.getId().toString())
                .setType(storeAccount.getType())
                .setName(storeAccount.getName())
                .setIdCard(storeAccount.getIdCard())
                .setEnterpriseName(storeAccount.getEnterpriseName())
                .setEnterpriseNo(storeAccount.getEnterpriseNo())
                .setBankNo(storeAccount.getBankNo())
                .setBankName(storeAccount.getBankName())
                .setBankBranchName(storeAccount.getBankBranchName())
                .setBankMobile(storeAccount.getBankMobile())
                .setBankCity(storeAccount.getBankCity())
                .setSort(storeAccount.getSort())
                .setStatus(storeAccount.getStatus())
                .setDefaultStatus(storeAccount.getDefaultStatus())
                .setAuditStatus(storeAccount.getAuditStatus());
        return storeAccountViewDto;
    }
}
